# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=kdelibs4support
pkgver=5.113.0
pkgrel=0
pkgdesc="Porting aid from KDELibs4"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-or-later AND MIT AND LGPL-2.1-only AND LGPL-2.0-only AND (LGPL-2.1-only OR LGPL-3.0-only) AND (LGPL-2.0-only OR LGPL-3.0-only)"
depends_dev="
	kcompletion5-dev
	kconfig5-dev
	kconfigwidgets5-dev
	kcrash5-dev
	kdbusaddons5-dev
	kded5-dev
	kdesignerplugin5
	kdesignerplugin5-dev
	kdoctools5-dev
	kemoticons5-dev
	kglobalaccel5-dev
	kguiaddons5-dev
	ki18n5-dev
	kiconthemes5-dev
	kinit5-dev
	kio5-dev
	kitemmodels5-dev
	knotifications5-dev
	kparts5-dev
	kservice5-dev
	ktextwidgets5-dev
	kunitconversion5-dev
	kwidgetsaddons5-dev
	kwindowsystem5-dev
	kxmlgui5-dev
	perl-uri
	qt5-qtbase-dev
	qt5-qttools-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	kded5
	samurai
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/frameworks/kdelibs4support.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/portingAids/kdelibs4support-$pkgver.tar.xz
	0001-fix-test-build.patch
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
options="suid !check" # Fails due to requiring running dbus

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
71c86d90a7381667c9aadec0299afb64b8f42a6d7366b4eba06ee93613de05de7eeeb249fad3746c55a5a1520bb233306e8a851a7351c0f4ce3edd06511cc8d9  kdelibs4support-5.113.0.tar.xz
a6359589e4d4fe71394dd9ccfd1910ee7fb20133b0032d24d4d8862e1900f61e1ac8ea059e734cde8ca5696abc970ebde54ba8fd92156c3de2ebdecbdbee7d8e  0001-fix-test-build.patch
"
